package com.yunji.system.service;


import com.yunji.common.model.domain.CaptchaPicsDO;
import com.yunji.common.model.params.CaptchaPicsParam;
import com.yunji.system.dao.ICaptchaPicsDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.common.service
 * @Title: CaptchaPicsService
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-11-19 11:22:25      V1.0        HuaAo       新建类
 */
@Service
@Slf4j
public class CaptchaPicsService {

    @Resource
    ICaptchaPicsDao captchaPicsDao;

    public Long create(CaptchaPicsDO captchaDO) {
        Assert.isTrue(captchaPicsDao.save(captchaDO), "新增失败");
        return captchaDO.getPicsId();
    }

    public boolean update(CaptchaPicsDO picsDO) {
        return captchaPicsDao.updateById(picsDO);
    }

    public List<CaptchaPicsDO> pageList(CaptchaPicsParam param) {
        return captchaPicsDao.pageList(param);
    }

    public boolean delete(Long picsId) {
        return captchaPicsDao.removeById(picsId);
    }

    public CaptchaPicsDO getInfo(Long picsId) {
        return captchaPicsDao.getById(picsId);
    }

    public List<CaptchaPicsDO> search(CaptchaPicsDO param) {
        return captchaPicsDao.search(param);
    }
}